]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: Remove desktop fade logic
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Thu, 17 Mar 2022 10:08:48 +0000 (18:08 +0800)
committerMarge Bot <marge-bot@gnome.org>
Sun, 20 Mar 2022 21:57:51 +0000 (21:57 +0000)
It existed to fade out/in `nautilus-desktop` for the overview, but it only
ever worked for X11 sessions (`Meta.WindowType.DESKTOP`) and
`nautilus-desktop` no longer exists anyway.

While I had suggested extending it in the past (!1395), that work was
never finished and since then the DING extension has implemented its
own visibility toggling. There seems little value in keeping the old
fade logic around in gnome-shell. Removing it actually fixes a bug with
DING (https://launchpad.net/bugs/1965072).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2244>

js/ui/overview.js
js/ui/overviewControls.js

index 73bef029456fc601472f30df15dba16ce5365319..96ccde521977733ed495468958a5fa7be3272e12 100644 (file)
@@ -1,5 +1,5 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-/* exported Overview */
+/* exported Overview, ANIMATION_TIME */
 
 const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
@@ -145,9 +145,6 @@ var Overview = class {
         if (this.isDummy)
             return;
 
-        this._desktopFade = new St.Widget();
-        Main.layoutManager.overviewGroup.add_child(this._desktopFade);
-
         this._activationTime = 0;
 
         this._visible = false;          // animating to overview, in overview, animating out
@@ -325,24 +322,6 @@ var Overview = class {
         return Clutter.EVENT_PROPAGATE;
     }
 
-    _getDesktopClone() {
-        let windows = global.get_window_actors().filter(
-            w => w.meta_window.get_window_type() === Meta.WindowType.DESKTOP);
-        if (windows.length == 0)
-            return null;
-
-        let window = windows[0];
-        const clone = new Clutter.Clone({
-            source: window,
-            x: window.x,
-            y: window.y,
-        });
-        clone.source.connect('destroy', () => {
-            clone.destroy();
-        });
-        return clone;
-    }
-
     _relayout() {
         // To avoid updating the position and size of the workspaces
         // we just hide the overview. The positions will be updated
@@ -442,34 +421,6 @@ var Overview = class {
         this._overview.searchEntry.grab_key_focus();
     }
 
-    fadeInDesktop() {
-        this._desktopFade.opacity = 0;
-        this._desktopFade.show();
-        this._desktopFade.ease({
-            opacity: 255,
-            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
-            duration: ANIMATION_TIME,
-        });
-    }
-
-    fadeOutDesktop() {
-        if (!this._desktopFade.get_n_children()) {
-            let clone = this._getDesktopClone();
-            if (!clone)
-                return;
-
-            this._desktopFade.add_child(clone);
-        }
-
-        this._desktopFade.opacity = 255;
-        this._desktopFade.show();
-        this._desktopFade.ease({
-            opacity: 0,
-            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
-            duration: ANIMATION_TIME,
-        });
-    }
-
     // Checks if the Activities button is currently sensitive to
     // clicks. The first call to this function within the
     // OVERVIEW_ACTIVATION_TIMEOUT time of the hot corner being
@@ -561,7 +512,6 @@ var Overview = class {
 
     _showDone() {
         this._animationInProgress = false;
-        this._desktopFade.hide();
         this._coverPane.hide();
 
         this.emit('shown');
@@ -617,7 +567,6 @@ var Overview = class {
         // Re-enable unredirection
         Meta.enable_unredirect_for_display(global.display);
 
-        this._desktopFade.hide();
         this._coverPane.hide();
 
         this._visible = false;
index 1268697ee294fd3553f885a5e85a454610369b8c..4dd9a979d3e96810f63d78bcbddc87c667dc476c 100644 (file)
@@ -708,8 +708,6 @@ class ControlsManager extends St.Widget {
 
         this._searchController.prepareToEnterOverview();
         this._workspacesDisplay.prepareToEnterOverview();
-        if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
-            Main.overview.fadeOutDesktop();
 
         this._stateAdjustment.value = ControlsState.HIDDEN;
         this._stateAdjustment.ease(state, {
@@ -731,8 +729,6 @@ class ControlsManager extends St.Widget {
         this._ignoreShowAppsButtonToggle = true;
 
         this._workspacesDisplay.prepareToLeaveOverview();
-        if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
-            Main.overview.fadeInDesktop();
 
         this._stateAdjustment.ease(ControlsState.HIDDEN, {
             duration: Overview.ANIMATION_TIME,